#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<cstring>
#define N 500005
using namespace std;
int T;
int f[N];
int n;
int a[N*2];
int l[N],r[N],tot;
string ans[N];
void built(){
	int x0,y0,x1,y1;
	for(int i=1;i<=tot;i++){
		int ff=0;
		x0=1,y0=2*n;
		x1=l[i],y1=r[i];
		while(x0<l[i]||r[i]<y0){
			while(a[x0]==a[x1]){
				ans[i][ff++]='L';
				x0++;
				x1++;
			}
			while(a[x0]==a[y1]){
				ans[i][ff++]='L';
				x0++;
				y1--;
			}
			while(a[y0]==a[x1]){
				ans[i][ff++]='R';
				y0--;
				x1++;
			}
			while(a[y0]==a[y1]){
				ans[i][ff++]='R';
				y0--;
				y1--;
			}
			//cout<<x0<<" "<<y0<<" "<<x1<<" "<<y1<<endl;
		}
	}
}
int main(){
	freopen("palin.in","r",stdin);
	freopen("palin.out","w",stdout);
	scanf("%d",&T);
	while(T--){
		memset(f,0,sizeof(f));
		scanf("%d",&n);
		bool flag=1;
		for(int i=1;i<=2*n;i++){
			scanf("%d",&a[i]);
		}
		for(int i=1;i<=n;i++){
			if(f[a[i]])flag=0;
			f[a[i]]=1;
		}
		if(!flag)cout<<-1<<endl;
		else{
			for(int i=1;i<=n;i++){
				cout<<"L";
			}
			for(int i=1;i<=n;i++){
				cout<<"R";
			}
			cout<<endl;
		}
	}
	fclose(stdin);
	fclose(stdout);
	return 0;
}
